import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
nlp = pd.read_csv("twibot_20_nlp.csv")
for col in nlp.columns[1:-1]:
x = nlp.loc[nlp["label"] == 1, col]
y = nlp.loc[nlp["label"] == 0, col]
bins = np.linspace(min(nlp[col]), max(nlp[col]), 50)
plt.hist(round(x, 5), bins, alpha=0.5, label='bots', weights=np.ones(len(x))/len(x))
plt.hist(y, bins, alpha=0.5, label='non-bots', weights=np.ones(len(y))/len(y))
plt.legend(loc='upper right')
plt.title(col)
#plt.savefig(f'./charts/{col}.pdf')
plt.show()
twibot_gf = pd.read_csv("twibot_20_gf.csv")
twibot_gf = pd.read_csv("twibot_20_gf.csv")
for col in twibot_gf.columns[1:-1]:
x = twibot_gf.loc[twibot_gf["label"] == 1, col]
y = twibot_gf.loc[twibot_gf["label"] == 0, col]
bins = np.linspace(min(twibot_gf[col]), max(twibot_gf[col]), 50)
plt.hist(round(x, 5), bins, alpha=0.5, label='bots', weights=np.ones(len(x))/len(x))
plt.hist(y, bins, alpha=0.5, label='non-bots', weights=np.ones(len(y))/len(y))
plt.legend(loc='upper right')
plt.title(col)
#plt.savefig(f'./charts/{col}.pdf')
plt.show()
bitcoin_alpha_gf = pd.read_csv("bitcoin_alpha_gf.csv")
for col in bitcoin_alpha_gf.columns[1:-1]:
x = bitcoin_alpha_gf.loc[bitcoin_alpha_gf["label"] == 1, col]
y = bitcoin_alpha_gf.loc[bitcoin_alpha_gf["label"] == 0, col]
bins = np.linspace(min(bitcoin_alpha_gf[col]), max(bitcoin_alpha_gf[col]), 50)
plt.hist(round(x, 5), bins, alpha=0.5, label='benign', weights=np.ones(len(x))/len(x))
plt.hist(y, bins, alpha=0.5, label='fraudulent', weights=np.ones(len(y))/len(y))
plt.legend(loc='upper right')
plt.title(col)
#plt.savefig(f'./charts/{col}.pdf')
plt.show()
bitcoin_otc_gf = pd.read_csv("bitcoin_otc_gf.csv")
for col in bitcoin_otc_gf.columns[1:-1]:
x = bitcoin_otc_gf.loc[bitcoin_otc_gf["label"] == 1, col]
y = bitcoin_otc_gf.loc[bitcoin_otc_gf["label"] == 0, col]
bins = np.linspace(min(bitcoin_otc_gf[col]), max(bitcoin_otc_gf[col]), 50)
plt.hist(round(x, 5), bins, alpha=0.5, label='benign', weights=np.ones(len(x))/len(x))
plt.hist(y, bins, alpha=0.5, label='fraudulent', weights=np.ones(len(y))/len(y))
plt.legend(loc='upper right')
plt.title(col)
#plt.savefig(f'./charts/{col}.pdf')
plt.show()